package com.webdesign.action;

import java.io.IOException;

import javax.annotation.Resource;
import javax.mail.MessagingException;
import javax.mail.internet.AddressException;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.webdesign.entity.TbTeacher;
import com.webdesign.service.ITbTeacherService;

@Controller("CheckTeacherAction")
@Scope("prototype")
public class CheckTeacherAction {
	
	//id为教师工号
	private String id;
	private TbTeacher checkTeacher;
	private ITbTeacherService iTbTeacherService;
	
	public String checkTeachers() throws AddressException, IOException, MessagingException
	{
		iTbTeacherService.checkTeacher(getId());
		return "success";
	}
	
	public String deleteTeachers()
	{
		Boolean flag = iTbTeacherService.deleteTeacher(getId());
		if(flag){
			return "success";
		}
		return "error";
	}



	public String getId() {
		return id;
	}



	public void setId(String id) {
		this.id = id;
	}



	public ITbTeacherService getiTbTeacherService() {
		return iTbTeacherService;
	}

	@Resource(name="TbTeacherService")
	public void setiTbTeacherService(ITbTeacherService iTbTeacherService) {
		this.iTbTeacherService = iTbTeacherService;
	}
	public TbTeacher getCheckTeacher() {
		return checkTeacher;
	}

	public void setCheckTeacher(TbTeacher checkTeacher) {
		this.checkTeacher = checkTeacher;
	}

}
